package org.dromara.erp.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.tenant.core.TenantEntity;

import java.io.Serial;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 采购入库对象 erp_warehousing
 *
 * @author Mr Lei
 * @date 2024-06-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("erp_warehousing")
public class ErpWarehousing extends TenantEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @NotNull(message = "ID不能为空",groups = {EditGroup.class})
    @TableId(value = "id")
    private Long id;

    /**
     * 订单编号
     */
    @NotBlank(message = "标题不能为空",groups = {AddGroup.class, EditGroup.class})
    @ExcelProperty(value = "标题")
    private String orderNo;

    /**
     * 采购订单
     */
    private Long purchaseId;
    @TableField(exist = false)
    private String purchaseName;

    /**
     * 供应商
     */
    @ExcelProperty(value = "供应端")
    private Long supplierId;
    @TableField(exist = false)
    private String supplierName;

    /**
     * 入库总数
     */
    @ExcelProperty(value = "入库总数")
    private BigDecimal totalNum;

    /**
     * 入库总价
     */
    @ExcelProperty(value = "入库总价")
    private BigDecimal totalMoney;

    /**
     * 采购人员
     */
    @ExcelProperty(value = "采购人员")
    private Long workerId;
    @TableField(exist = false)
    private String workerName;

    /**
     * 采购日期
     */
    @ExcelProperty(value = "采购日期")
    private Date buyTime;

    /**
     * 审核状态
     */
    private String auditStatus;

    /**
     * 备注
     */
    private String remark;

    /**
     * 单据状态
     */
    private String status;

    /**
     * 审核时间
     */
    private Date auditTime;

    /**
     * 审核备注
     */
    private String auditRemark;

    /**
     * 审核人
     */
    private Long auditUserId;
    @TableField(exist = false)
    private String auditUserName;

    /*info详情*/
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @TableField(exist = false)
    private List<ErpWarehousingInfo> contentInfo;


}
